using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._UtilityNetworkTools._Administration
{
    /// <summary>
    /// <para>Add Rule</para>
    /// <para>Adds a rule to a utility network.</para>
    /// <para>将规则添加到公共设施网络。</para>
    /// </summary>    
    [DisplayName("Add Rule")]
    public class AddRule : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public AddRule()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_utility_network">
        /// <para>Input Utility Network</para>
        /// <para>The utility network for which the rule will be added.</para>
        /// <para>将为其添加规则的公共设施网络。</para>
        /// </param>
        /// <param name="_rule_type">
        /// <para>Rule Type</para>
        /// <para><xdoc>
        ///   <para>The type of rule to be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Junction-junction connectivity—Creates a junction-junction connectivity rule allowing two point features to connect via a connectivity association (features are offset geometrically).</bullet_item><para/>
        ///     <bullet_item>Containment—Creates a containment rule where the from parameters are the container and the to parameters are the contents in a containment association.</bullet_item><para/>
        ///     <bullet_item>Structural attachment—Creates a structural attachment rule where the from parameters are the structure features and the to parameters are the attachment features in a structural attachment association.</bullet_item><para/>
        ///     <bullet_item>Junction-edge connectivity—Creates an edge-junction connectivity rule allowing edge and junction features to connect via geometric coincidence (features are at the same x,y,z location).</bullet_item><para/>
        ///     <bullet_item>Edge-junction-edge connectivity—Creates an edge-junction-edge connectivity rule allowing a edge to connect to either side of a junction feature.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的规则类型。</para>
        ///   <bulletList>
        ///     <bullet_item>交汇点-交汇点连通性 - 创建交汇点-交汇点连通性规则，允许两个点要素通过连通性关联进行连接（要素以几何方式偏移）。</bullet_item><para/>
        ///     <bullet_item>包含 （Containment） - 创建包含规则，其中 from 参数是容器，to 参数是包含关联中的内容。</bullet_item><para/>
        ///     <bullet_item>结构附件 （Structural attachment） - 创建结构附件规则，其中 from 参数是结构附件关联中的结构特征，to 参数是结构附件关联中的附件要素。</bullet_item><para/>
        ///     <bullet_item>交汇点-边连通性 - 创建边-交汇点连通规则，允许边和交汇点要素通过几何重合进行连接（要素位于同一 x、y、z 位置）。</bullet_item><para/>
        ///     <bullet_item>边-交汇点-边连通性 - 创建边-交汇点-边连通性规则，允许边连接到交汇点要素的任一侧。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_from_class">
        /// <para>From Table</para>
        /// <para><xdoc>
        ///   <para>The from utility network feature class or table that will be included in the rule.</para>
        ///   <para>Structural attachment and containment association rules require that the container or structure feature be in this parameter.</para>
        ///   <para>Ordering is irrelevant for the junction-junction, junction-edge, and edge-junction-edge connectivity rules.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含在规则中的“来自公共设施网络”要素类或表。</para>
        ///   <para>结构附件和包含关联规则要求容器或结构要素在此参数中。</para>
        ///   <para>排序与交汇点-交汇点、交汇点-边和边-交汇点-边连通性规则无关。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_from_assetgroup">
        /// <para>From Asset Group</para>
        /// <para>An asset group for the From Table to which the rule will apply.</para>
        /// <para>将应用规则的“从表”的资产组。</para>
        /// </param>
        /// <param name="_from_assettype">
        /// <para>From Asset Type</para>
        /// <para>An asset type for the From Table to which the rule will apply.</para>
        /// <para>将应用规则的“从表”的资产类型。</para>
        /// </param>
        /// <param name="_to_class">
        /// <para>To Table</para>
        /// <para><xdoc>
        ///   <para>The to utility network feature class or table that will be included in the rule.</para>
        ///   <para>Structural attachment and containment associations rules require that the content or attachment feature be in this parameter.</para>
        ///   <para>Ordering is irrelevant for the junction-junction, junction-edge, and edge-junction-edge connectivity rules.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含在规则中的公共设施网络要素类或表。</para>
        ///   <para>结构附件和包含关联规则要求内容或附件要素位于此参数中。</para>
        ///   <para>排序与交汇点-交汇点、交汇点-边和边-交汇点-边连通性规则无关。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_to_assetgroup">
        /// <para>To Asset Group</para>
        /// <para>An asset group for the To Table to which the rule will apply.</para>
        /// <para>规则将应用于的“目标表”的资产组。</para>
        /// </param>
        /// <param name="_to_assettype">
        /// <para>To Asset Type</para>
        /// <para>An asset type for the To Table to which the rule will apply.</para>
        /// <para>规则将应用于的“目标表”的资产类型。</para>
        /// </param>
        public AddRule(object _in_utility_network, _rule_type_value? _rule_type, object _from_class, object _from_assetgroup, object _from_assettype, object _to_class, object _to_assetgroup, object _to_assettype)
        {
            this._in_utility_network = _in_utility_network;
            this._rule_type = _rule_type;
            this._from_class = _from_class;
            this._from_assetgroup = _from_assetgroup;
            this._from_assettype = _from_assettype;
            this._to_class = _to_class;
            this._to_assetgroup = _to_assetgroup;
            this._to_assettype = _to_assettype;
        }
        public override string ToolboxName => "Utility Network Tools";

        public override string ToolName => "Add Rule";

        public override string CallName => "un.AddRule";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_utility_network, _rule_type.GetGPValue(), _from_class, _from_assetgroup, _from_assettype, _to_class, _to_assetgroup, _to_assettype, _from_terminal, _to_terminal, _via_class, _via_assetgroup, _via_assettype, _via_terminal, _out_utility_network];

        /// <summary>
        /// <para>Input Utility Network</para>
        /// <para>The utility network for which the rule will be added.</para>
        /// <para>将为其添加规则的公共设施网络。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Utility Network")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_utility_network { get; set; }


        /// <summary>
        /// <para>Rule Type</para>
        /// <para><xdoc>
        ///   <para>The type of rule to be created.</para>
        ///   <bulletList>
        ///     <bullet_item>Junction-junction connectivity—Creates a junction-junction connectivity rule allowing two point features to connect via a connectivity association (features are offset geometrically).</bullet_item><para/>
        ///     <bullet_item>Containment—Creates a containment rule where the from parameters are the container and the to parameters are the contents in a containment association.</bullet_item><para/>
        ///     <bullet_item>Structural attachment—Creates a structural attachment rule where the from parameters are the structure features and the to parameters are the attachment features in a structural attachment association.</bullet_item><para/>
        ///     <bullet_item>Junction-edge connectivity—Creates an edge-junction connectivity rule allowing edge and junction features to connect via geometric coincidence (features are at the same x,y,z location).</bullet_item><para/>
        ///     <bullet_item>Edge-junction-edge connectivity—Creates an edge-junction-edge connectivity rule allowing a edge to connect to either side of a junction feature.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要创建的规则类型。</para>
        ///   <bulletList>
        ///     <bullet_item>交汇点-交汇点连通性 - 创建交汇点-交汇点连通性规则，允许两个点要素通过连通性关联进行连接（要素以几何方式偏移）。</bullet_item><para/>
        ///     <bullet_item>包含 （Containment） - 创建包含规则，其中 from 参数是容器，to 参数是包含关联中的内容。</bullet_item><para/>
        ///     <bullet_item>结构附件 （Structural attachment） - 创建结构附件规则，其中 from 参数是结构附件关联中的结构特征，to 参数是结构附件关联中的附件要素。</bullet_item><para/>
        ///     <bullet_item>交汇点-边连通性 - 创建边-交汇点连通规则，允许边和交汇点要素通过几何重合进行连接（要素位于同一 x、y、z 位置）。</bullet_item><para/>
        ///     <bullet_item>边-交汇点-边连通性 - 创建边-交汇点-边连通性规则，允许边连接到交汇点要素的任一侧。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Rule Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _rule_type_value? _rule_type { get; set; }

        public enum _rule_type_value
        {
            /// <summary>
            /// <para>Junction-junction connectivity</para>
            /// <para>Junction-junction connectivity—Creates a junction-junction connectivity rule allowing two point features to connect via a connectivity association (features are offset geometrically).</para>
            /// <para>交汇点-交汇点连通性 - 创建交汇点-交汇点连通性规则，允许两个点要素通过连通性关联进行连接（要素以几何方式偏移）。</para>
            /// </summary>
            [Description("Junction-junction connectivity")]
            [GPEnumValue("JUNCTION_JUNCTION_CONNECTIVITY")]
            _JUNCTION_JUNCTION_CONNECTIVITY,

            /// <summary>
            /// <para>Junction-edge connectivity</para>
            /// <para>Junction-edge connectivity—Creates an edge-junction connectivity rule allowing edge and junction features to connect via geometric coincidence (features are at the same x,y,z location).</para>
            /// <para>交汇点-边连通性 - 创建边-交汇点连通规则，允许边和交汇点要素通过几何重合进行连接（要素位于同一 x、y、z 位置）。</para>
            /// </summary>
            [Description("Junction-edge connectivity")]
            [GPEnumValue("JUNCTION_EDGE_CONNECTIVITY")]
            _JUNCTION_EDGE_CONNECTIVITY,

            /// <summary>
            /// <para>Containment</para>
            /// <para>Containment—Creates a containment rule where the from parameters are the container and the to parameters are the contents in a containment association.</para>
            /// <para>包含 （Containment） - 创建包含规则，其中 from 参数是容器，to 参数是包含关联中的内容。</para>
            /// </summary>
            [Description("Containment")]
            [GPEnumValue("CONTAINMENT")]
            _CONTAINMENT,

            /// <summary>
            /// <para>Structural attachment</para>
            /// <para>Structural attachment—Creates a structural attachment rule where the from parameters are the structure features and the to parameters are the attachment features in a structural attachment association.</para>
            /// <para>结构附件 （Structural attachment） - 创建结构附件规则，其中 from 参数是结构附件关联中的结构特征，to 参数是结构附件关联中的附件要素。</para>
            /// </summary>
            [Description("Structural attachment")]
            [GPEnumValue("STRUCTURAL_ATTACHMENT")]
            _STRUCTURAL_ATTACHMENT,

            /// <summary>
            /// <para>Edge-junction-edge connectivity</para>
            /// <para>Edge-junction-edge connectivity—Creates an edge-junction-edge connectivity rule allowing a edge to connect to either side of a junction feature.</para>
            /// <para>边-交汇点-边连通性 - 创建边-交汇点-边连通性规则，允许边连接到交汇点要素的任一侧。</para>
            /// </summary>
            [Description("Edge-junction-edge connectivity")]
            [GPEnumValue("EDGE_JUNCTION_EDGE_CONNECTIVITY")]
            _EDGE_JUNCTION_EDGE_CONNECTIVITY,

        }

        /// <summary>
        /// <para>From Table</para>
        /// <para><xdoc>
        ///   <para>The from utility network feature class or table that will be included in the rule.</para>
        ///   <para>Structural attachment and containment association rules require that the container or structure feature be in this parameter.</para>
        ///   <para>Ordering is irrelevant for the junction-junction, junction-edge, and edge-junction-edge connectivity rules.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含在规则中的“来自公共设施网络”要素类或表。</para>
        ///   <para>结构附件和包含关联规则要求容器或结构要素在此参数中。</para>
        ///   <para>排序与交汇点-交汇点、交汇点-边和边-交汇点-边连通性规则无关。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _from_class { get; set; }


        /// <summary>
        /// <para>From Asset Group</para>
        /// <para>An asset group for the From Table to which the rule will apply.</para>
        /// <para>将应用规则的“从表”的资产组。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Asset Group")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _from_assetgroup { get; set; }


        /// <summary>
        /// <para>From Asset Type</para>
        /// <para>An asset type for the From Table to which the rule will apply.</para>
        /// <para>将应用规则的“从表”的资产类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Asset Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _from_assettype { get; set; }


        /// <summary>
        /// <para>To Table</para>
        /// <para><xdoc>
        ///   <para>The to utility network feature class or table that will be included in the rule.</para>
        ///   <para>Structural attachment and containment associations rules require that the content or attachment feature be in this parameter.</para>
        ///   <para>Ordering is irrelevant for the junction-junction, junction-edge, and edge-junction-edge connectivity rules.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将包含在规则中的公共设施网络要素类或表。</para>
        ///   <para>结构附件和包含关联规则要求内容或附件要素位于此参数中。</para>
        ///   <para>排序与交汇点-交汇点、交汇点-边和边-交汇点-边连通性规则无关。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _to_class { get; set; }


        /// <summary>
        /// <para>To Asset Group</para>
        /// <para>An asset group for the To Table to which the rule will apply.</para>
        /// <para>规则将应用于的“目标表”的资产组。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Asset Group")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _to_assetgroup { get; set; }


        /// <summary>
        /// <para>To Asset Type</para>
        /// <para>An asset type for the To Table to which the rule will apply.</para>
        /// <para>规则将应用于的“目标表”的资产类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Asset Type")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _to_assettype { get; set; }


        /// <summary>
        /// <para>From Terminal</para>
        /// <para><xdoc>
        ///   <para>The from terminal to which the rule will apply. This will be a terminal in the From Table. When creating a connectivity rule for feature with terminals to connect to another feature, the terminal side to connect from must be specified, for example, the high-side terminal on a transformer.</para>
        ///   <para>This parameter is required if the asset type has terminals. It is disabled when the structural attachment or containment association rule is specified in the Rule Type parameter.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>规则将应用到的发件人终端。这将是“从表”中的终端。为具有端子的要素创建连通性规则以连接到另一个要素时，必须指定要连接的端子侧，例如，变压器上的高侧端子。</para>
        ///   <para>如果资产类型有终端，则此参数为必填项。在规则类型参数中指定结构附件或包含关联规则时，该规则将被禁用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("From Terminal")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _from_terminal { get; set; } = null;


        /// <summary>
        /// <para>To Terminal</para>
        /// <para><xdoc>
        ///   <para>The to terminal to which the rule will apply. This will be a terminal in the To Table. When creating a connectivity rule for feature to connect to another feature with terminals, the terminal side to connect to must be specified, for example, the low-side terminal on a transformer.</para>
        ///   <para>This parameter is required if the asset type has terminals. It is disabled for structural attachment or containment association rule types.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>规则将应用到的 to 终端。这将是“目标表”中的一个终端。为要素创建连通规则以通过端子连接到另一个要素时，必须指定要连接的端子侧，例如变压器上的低侧端子。</para>
        ///   <para>如果资产类型有终端，则此参数为必填项。对于结构附件或包含关联规则类型，它被禁用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("To Terminal")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _to_terminal { get; set; } = null;


        /// <summary>
        /// <para>Via Table</para>
        /// <para>The junction utility network feature class or table to which the rule will apply. This parameter is available only when edge-junction-edge connectivity is selected for the Rule Type parameter, since three feature classes or tables are required to participate in edge-junction-edge connectivity.</para>
        /// <para>规则将应用到的交汇点公共设施网络要素类或表。仅当为规则类型参数选择边-交汇点-边连通性时，此参数才可用，因为需要三个要素类或表才能参与边-交汇点-边连通性。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Via Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _via_class { get; set; } = null;


        /// <summary>
        /// <para>Via Asset Group</para>
        /// <para>An asset group of the Via Table to which the rule will apply. This parameter is available only when edge-junction-edge connectivity is selected for the Rule Type parameter.</para>
        /// <para>规则将应用于的 Via Table 的资产组。仅当为规则类型参数选择了边-交汇点-边连通性时，此参数才可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Via Asset Group")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _via_assetgroup { get; set; } = null;


        /// <summary>
        /// <para>Via Asset Type</para>
        /// <para>An asset type of the Via Table to which the rule will apply. This parameter is available only when edge-junction-edge connectivity is selected for the Rule Type parameter</para>
        /// <para>规则将应用于的 Via Table 的资产类型。仅当为规则类型参数选择了边-交汇点-边连通性时，此参数才可用</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Via Asset Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _via_assettype { get; set; } = null;


        /// <summary>
        /// <para>Via Terminal</para>
        /// <para>The terminal from the Via Table to which the rule will apply. This parameter is available only when edge-junction-edge connectivity is selected for the Rule Type parameter.</para>
        /// <para>Via Table 中将应用规则的终端。仅当为规则类型参数选择了边-交汇点-边连通性时，此参数才可用。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Via Terminal")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _via_terminal { get; set; } = null;


        /// <summary>
        /// <para>Updated Utility Network</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Utility Network")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_utility_network { get; set; }


        public AddRule SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}